<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$return['diy']=$this->plugin_setting('diy');
$basic=$this->plugin_setting('basic');
$return['hdps']=$basic['hdps'];
if($_RQ['op']=='main'){	
	set_html('title','科室列表');
	$return['sharedata']=array(
		'title'=>'科室列表'.$basic['share_title'],
		'desc'=>'科室列表'.$basic['share_desc'],
		'link'=>custom_url('jy_yiliao/lesson_list/',true),
		'imgUrl'=>ATTACHMENT_URL.$basic['share_image'],
	);
	$return['storetype']=0;
	exi($return);
}
if($_RQ['op']=='getlist'){
	$post=get_postdata();
	$params=array('uniacid'=>$_SESSION['uniacid'],'status'=>1);
	$params['storetype']=intval($_RQ['storetype']);
	//排序门店
	$pindex = max(1, intval($_RQ['page']));
	$psize = 10;
	
	//$list=pdo_getslice('jy_yiliao_store',$params,array($pindex,$psize),$total,$fields,'','id desc');
	$pindex = max(1, intval($_RQ['page']));
	$psize = 10;
	$total='';
	$return['status']=0;
	$parameter=array(
		'params'=>$params,
		'limit'=>array($pindex,$psize),
		'fields'=>$fields,
		'orderby'=>$orderby,
	);
	$list=pdo_getslice('jy_yiliao_lesson',$params,array($pindex,$psize),$total,$fields,'','id desc');
	$sum=0;
	if($list){
		$sum=count($list);
		foreach($list as &$item){		
			$item['createtime']=date('Y-m-d H:i:s',$item['createtime']);
		}
	}
	$return['list']=$list;
	$return['sum']=$sum;
	exi($return);
}
	
